//06-11-2009 sourabh bora

var macro;
var jsLF = "\n";
var i, retcode, errtext;
//var noOftargets = prompt("how many targets?", "190");
for(i=1;;i++) {
    iimDisplay("loop  i="+i);
	macro = "CODE:";
	macro+= "URL GOTO=http://seeker.dice.com/jobsearch/servlet/JobSearch?SORTDIR=5&NUM_PER_PAGE=200&FRMT=1&caller=2&LOCATION_OPTION=2&Ntx=mode+matchall&op=300&RADIUS=64.37376&N=1002+3007+1005&SORTSPEC=0&FREE_TEXT=abap&Ns=p_Municipality|0&registerRemSw=0&TAXTERM=1002&TAXTERM=1005&DAYSBACK=2" + jsLF;
	retcode = iimPlay(macro);

	if (retcode < 0) {              // an error has occured
		errtext = "Page Opening Error on page:"+i+"->"+iimGetLastError();
		//alert(errtext);
	}
	macro = "CODE:";
	macro+="FILEDELETE NAME=D:\\scripts\\dice\\new.html"  + jsLF;
	retcode=iimPlay(macro);
    if (retcode < 0) {          // an error has occured
        errtext+="Error saving"+i+" th page-> "+iimGetLastError();
    }
    macro = "CODE:";
	macro+="SAVEAS TYPE=TXT FOLDER=D:\\scripts\\dice\\ FILE=new.html" + jsLF;
	macro+="WAIT SECONDS=600" + jsLF;
	retcode=iimPlay(macro);
    if (retcode < 0) {          // an error has occured
        errtext+="Error saving"+i+" th page-> "+iimGetLastError();
             continue;
    }
		
}  

  alert(errtext);

iimDisplay("Script completed.");
